﻿using System;

namespace PhotonModel
{
	public class Parameters
	{
		private double _mass;
		private double _waveLength;
		private double _spinRaduis;
		private double _linearOscillationFrequency;
		private double _angularRotationFrequency;
		private double _centerOfMassOscillationAmplitude;
		private double _linearMotionSpeed;
		private double _energy;
		private double _osillationPeriod;

		public Parameters(double waveLength)
		{
			_waveLength = waveLength;
			RecalculateParameters(_waveLength);
		}

		private void RecalculateParameters(double waveLength)
		{
			_spinRaduis = waveLength;
			_linearOscillationFrequency = World.Constants.LightSpeed/waveLength;
			_angularRotationFrequency = _linearOscillationFrequency*2*Math.PI;
			_mass = World.Constants.LocaleConst/waveLength;
			LinearMotionSpeed = _linearOscillationFrequency*_waveLength;
			_energy = World.Constants.PlanckConst*_linearOscillationFrequency;
			_osillationPeriod = 1/_linearOscillationFrequency;
			_centerOfMassOscillationAmplitude = 0.067*_waveLength;
		}


		public double m
		{
			get { return _mass; }
			set { _mass = value; }
		}

		public double lambda
		{
			get { return _waveLength; }
			set { _waveLength = value; }
		}

		public double r
		{
			get { return _spinRaduis; }
			set { _spinRaduis = value; }
		}

		public double v
		{
			get { return _linearOscillationFrequency; }
			set { _linearOscillationFrequency = value; }
		}

		public double w
		{
			get { return _angularRotationFrequency; }
			set { _angularRotationFrequency = value; }
		}

		public double A
		{
			get { return _centerOfMassOscillationAmplitude; }
			set { _centerOfMassOscillationAmplitude = value; }
		}

		public double E
		{
			get { return _energy; }
			set { _energy = value; }
		}

		public double T
		{
			get { return _osillationPeriod; }
			set { _osillationPeriod = value; }
		}

		public double LinearMotionSpeed
		{
			get { return _linearMotionSpeed; }
			set { _linearMotionSpeed = value; }
		}
	}
}
